package com.nandi.emergencyinspection.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.nandi.emergencyinspection.R
import com.nandi.emergencyinspection.bean.MacroBean
import com.nandi.emergencyinspection.bean.MacroInfoListBean
import com.nandi.emergencyinspection.bean.TaskListBean

/**
 * @创建者: qingsong
 * @创建时间: 2021/3/25 16:15
 * @描述:
 */
class MacroLookListAdapter(data: MutableList<MacroInfoListBean.RecordsBean?>) :
    BaseQuickAdapter<MacroInfoListBean.RecordsBean?, BaseViewHolder>(
        R.layout.macro_look_list_item,
        data
    ),
    LoadMoreModule {
    override fun convert(
        holder: BaseViewHolder, item: MacroInfoListBean.RecordsBean?
    ) {
        holder.setText(R.id.disaster_name, "上报时间：${item?.createTime}")

        var result: String = if (1 == item?.warnLevel) {
            "红色告警"
        } else if (2 == item?.warnLevel) {
            "橙色告警"
        } else if (3 == item?.warnLevel) {
            "黄色告警"
        } else if (4 == item?.warnLevel) {
            "蓝色告警"
        } else {
            "正常"
        }
        holder.setText(R.id.result, "上报结果：${result}")
    }
}